# Definition for singly-linked list.
class ListNode:
    def __init__(self, x):
        self.val = x
        self.next = None

def reversePrint(head: ListNode) -> list:
    arr = []
    while head:
        arr.append(head.val)
        head = head.next
    return arr[::-1]


if __name__ == "__main__":
    n1 = ListNode(1)
    n2 = ListNode(3)
    n3 = ListNode(2)
    n1.next = n2
    n2.next = n3

    print(reversePrint(n1))
    print("Done!")